<?php
/**
 * Integration test with ExampleClassLoader.
 *
 * @author      Frank Kleine <mikey@xjconf.net>
 * @package     XJConf
 * @subpackage  test_integration
 */
require_once EXAMPLES_DIR . '/ClassLoader.php';
/**
 * Integration test with ExampleClassLoader.
 *
 * @package     XJConf
 * @subpackage  test_integration
 */
class ExampleClassLoaderTestCase extends UnitTestCase
{
    /**
     * test if using a class loader works
     */
    public function testExampleClassLoader()
    {
        $tagParser = new DefinitionParser(array('http://xjconf.net/example/ClassLoader' => new ClassLoader()));
        $defs      = $tagParser->parse(EXAMPLES_DIR . '/xml/defines-classloader.xml');
        
        $conf = new XmlParser();
        $conf->setTagDefinitions($defs);
        $conf->parse(EXAMPLES_DIR . '/xml/test-classloader.xml');
        
        $this->assertIsA($conf->getConfigValue('nestedClass'), 'MyNestedClass');
        $this->assertIsA($conf->getConfigValue('otherClass'), 'MyClass');
    }
}
?>